package gui;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Message implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private String time;
	private String author;
	private String msg;
	private String conversationName;
	private Map<String, String> sendTo;
	
	public Message(String conversatioName, String time, String author, String msg) {
		this.time = time;
		this.author = author;
		this.msg = msg;
		this.sendTo = new HashMap<String, String>();
		this.conversationName = conversatioName;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public String getConversationName() {
		return conversationName;
	}

	public void setConversationName(String conversationName) {
		this.conversationName = conversationName;
	}

	public void addSendTo(String[] contacts){
		for(String contact : contacts){
			this.sendTo.put(contact, contact);
			System.out.print(contact + " ");
		}
	}
	
	public Map<String, String> getSendTo(){
		return sendTo;
	}
}
